Skip to content

ADFA-5097: Clean up telemetry choice screen - #1658

Merged
hal-eisen-adfa merged 3 commits into
stagefrom
ADFA-5097-telemetry-choice-cleanup
Aug 11, 2026
Merged

ADFA-5097: Clean up telemetry choice screen#1658
hal-eisen-adfa merged 3 commits into
stagefrom
ADFA-5097-telemetry-choice-cleanup

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes ADFA-5097.

Root cause

All five complaints trace to one thing: the consent screen was a stock MaterialAlertDialog built from setTitle + setMessage + three buttons. Once the message overflows at large font scale, Material's own dialog produces exactly the reported symptoms.

Ticket item Cause
1. Strange lines top and bottom Material's scrollIndicatorUp/Down, shown only when the message pane overflows
2. Choices look like plain text They are the dialog's borderless text buttons; long labels force vertical stacking
3. Scrollable but doesn't look it No persistent scrollbar on the message pane
7. Body and choices scroll separately Material's dialog is a scrolling message pane plus a fixed button bar, by construction
4. "Learn more" goes off-device ACTION_VIEW to a PDF on appdevforall.org

Worth calling out: in the reported screenshot the button bar is pushed off-screen, so "Keep offline" is half-cut and "Learn more" is gone. On a setCancelable(false) dialog the user could not see or reach the decline option at all.

Items 1, 3 and 7 are properties of the widget, not of its styling, so the dialog now supplies its whole body as a custom view with the choices inside the scroll container.

Changes

  • New layout_dialog_privacy_consent.xml - one NestedScrollView holding the body text and both choices. No dividers (Material only draws them around a message pane, and there is no longer a message). fadeScrollbars="false" so the scrollbar is visible before the user touches anything. Choices are full-width filled/outlined MaterialButtons.
  • Choice panel background is ?attr/colorSurfaceVariant, not a surfaceContainer role. This app's themes define colorSurfaceVariant per-theme but leave the container roles to the Material3 defaults - and a Material3 dialog is colorSurfaceContainerHigh, so the panel was invisible until this was changed.
  • PermissionsFragment.showPrivacyDialog() rewritten; openPrivacyPolicy() deleted. Now uses DialogUtils.newMaterialDialogBuilder() - this dialog was the only one in the app built with a bare MaterialAlertDialogBuilder, so it was silently missing the app's corner radius and enter/exit animators. Inflated from builder.context so the dialog-scoped theme attributes resolve.
  • Copy condensed to two paragraphs, dropping the Firebase/GlitchTip names and the privacy-policy paragraph (ticket item 9). At font scale 2.0 it now fits with no scrolling at all.
  • "Learn more" removed, per the ticket's own preference. privacy_policy_url had no other consumer and is deleted.
  • zh-rCN and in-rID retranslated. These were not merely stale: both were missing privacy_disclosure_decline entirely and rendered accept as "I understand" / "Saya mengerti", so those users saw a one-button dialog whose button said something the English never said. Round-tripped back to English via translate-strings-xml.py - no semantic drift, \n\n escapes intact. (Only the Gemini leg ran; the Google Cloud Translate leg needs gcloud auth application-default login.)
  • Instrumented helper drops its "Learn more" assertion. Its click helper matches on exact full text and isClickable, so paragraph 2 repeating the button labels does not confuse it.

Verification

Built and exercised on an arm64 emulator, fresh install each run:

  • Font scale 1.0 - no dividers, both buttons visible, nothing scrolls.
  • Font scale 2.0 (the scale that reproduced the bug) - fits with room to spare, nothing clips.
  • Font scale 3.0 - forced overflow, since the condensed copy no longer overflows at 2.0 and the scroll path would otherwise go untested. Scrollbar visible without touching the screen; scrolling brings both buttons fully into reach in the same container - the case that was previously unreachable.
  • Light and dark themes - tonal panel holds contrast in both.
  • Accept persists GRANTED, decline persists DECLINED (verified in ide.stats.xml); dialog does not reappear.
  • :app:assembleV8Debug, :app:compileV8DebugAndroidTestKotlin, and spotlessCheck all pass.

Screenshots at each scale are in the ticket.

The consent dialog was a stock MaterialAlertDialog built from setTitle +
setMessage + three buttons. Every complaint in the ticket was that widget's
behavior once the message overflowed at large font scale: Material draws
scroll-indicator dividers around the message pane, the borderless text buttons
read as plain text, and the message scrolls while the button bar stays fixed.
On the reported device the button bar was pushed off-screen entirely, leaving
"Keep offline" half-cut and "Learn more" invisible - the decline option was
unreachable on a non-cancelable dialog.

Styling could not fix that, so the dialog now takes a custom view holding the
body and both choices in one NestedScrollView:

- No dividers. Material only draws them around the message pane, and there is
  no longer a message.
- Choices are real filled/outlined MaterialButtons, full width, stacked.
- Body and choices scroll together, and the scrollbar is non-fading so
  scrollability is visible before the user touches anything.
- The choice panel sits on colorSurfaceVariant to set it off from the body.
  Not a surfaceContainer role: this app's themes define colorSurfaceVariant but
  leave the container roles to the Material3 defaults, and a Material3 dialog
  is itself colorSurfaceContainerHigh, so such a panel would be invisible.

Copy condensed to two paragraphs, dropping the Firebase/GlitchTip names and the
privacy-policy paragraph. At font scale 2.0 it now fits without scrolling at all.

"Learn more" is removed. It opened an off-device PDF via ACTION_VIEW - exactly
what the app tries to avoid - and the content is legal boilerplate already on
the website. privacy_policy_url had no other consumer and is deleted too.

Also retranslates the zh-rCN and in-rID strings, which were not merely stale:
both were missing privacy_disclosure_decline entirely and rendered "accept" as
"I understand" / "Saya mengerti", so those users saw a one-button dialog whose
button said something the English never said.

Verified on an arm64 emulator at font scale 1.0 and 2.0, plus 3.0 to force
overflow and confirm the scrollbar appears and both buttons scroll into reach.
Light and dark themes checked; accept persists GRANTED and decline persists
DECLINED.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ec25677-9ddb-45a9-abc2-f382c08ff6d1

📥 Commits

Reviewing files that changed from the base of the PR and between 3afb987 and a1f0758.

📒 Files selected for processing (2)
  • resources/src/main/res/values-in-rID/strings.xml
  • resources/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • resources/src/main/res/values/strings.xml
  • resources/src/main/res/values-in-rID/strings.xml

📝 Walkthrough
  • Redesigned the telemetry consent dialog with a themed custom layout.
  • Added a scrollable consent message and choice section with a visible scrollbar.
  • Added full-width “Share anonymous data” and “Stay offline” buttons.
  • Italicized the choice names in the consent text.
  • Removed the “Learn more” link and privacy-policy URL.
  • Updated the English, Chinese, and Indonesian consent strings.
  • Removed “Learn more” verification from the privacy disclosure test.
  • Risk: Custom dialog styling and translated consent text require review across supported devices, screen sizes, font scales, themes, and accessibility settings.

Walkthrough

The privacy consent dialog now uses a custom layout with updated localized disclosure text. It offers anonymous-data sharing or offline operation. The Learn more action and related test assertions were removed while consent persistence remains.

Changes

Privacy consent flow

Layer / File(s) Summary
Consent content and layout
app/src/main/res/layout/layout_dialog_privacy_consent.xml, resources/src/main/res/values*/strings.xml
The dialog now displays a scrollable disclosure message with accept and offline choices. Localized strings were updated, and Learn more and privacy-policy resources were removed.
Dialog integration and validation
app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt, app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt
PermissionsFragment inflates the bound layout through DialogUtils. Accept and decline callbacks retain telemetry handling. The test helper no longer checks for Learn more.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: jomen-adfa

Poem

A rabbit checks the dialog bright,
Two choices keep the path clear:
Share anonymous data,
Or remain offline.
Learn more hops away.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: cleanup of the telemetry consent choice screen.
Description check ✅ Passed The description directly explains the consent dialog redesign, translation updates, removed privacy-policy action, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-5097-telemetry-choice-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/res/layout/layout_dialog_privacy_consent.xml`:
- Around line 39-51: Add meaningful android:contentDescription values to the
MaterialButtons privacy_accept and privacy_decline using new cd_* string
resources, then register the required long-press tooltips for both controls in
PermissionsFragment where their listeners are bound, following the existing
three-tier idetooltips pattern.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b979853-d93d-40ec-9d34-9b2dce0caf35

📥 Commits

Reviewing files that changed from the base of the PR and between 64d9222 and 3afb987.

📒 Files selected for processing (6)
  • app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt
  • app/src/main/java/com/itsaky/androidide/fragments/onboarding/PermissionsFragment.kt
  • app/src/main/res/layout/layout_dialog_privacy_consent.xml
  • resources/src/main/res/values-in-rID/strings.xml
  • resources/src/main/res/values-zh-rCN/strings.xml
  • resources/src/main/res/values/strings.xml
💤 Files with no reviewable changes (1)
  • app/src/androidTest/kotlin/com/itsaky/androidide/helper/HandlePrivacyDisclosureHelper.kt

Comment thread app/src/main/res/layout/layout_dialog_privacy_consent.xml
Paragraph 2 names the two choices; setting them in italics makes them stand
out and hints at the buttons below.

Inline <i> markup in the string resource. The layout binds via android:text,
so TextView picks up the style spans directly - getString() would have
stripped them, but nothing here calls it.

Not applied to zh-rCN: synthetic obliquing of Han characters renders poorly,
and that translation already sets the two choice names off with the
conventional CJK quotation marks.
@hal-eisen-adfa
hal-eisen-adfa requested a review from a team August 11, 2026 20:42
@hal-eisen-adfa
hal-eisen-adfa merged commit ffb63dd into stage Aug 11, 2026
4 checks passed
@hal-eisen-adfa
hal-eisen-adfa deleted the ADFA-5097-telemetry-choice-cleanup branch August 11, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants